# 目标数字
target_number = 7
# 最大次数限制
max_times = 3
# 记录已经猜了多少次
guess_numer = 0
# 定义一个标识
flag = False
while guess_numer < max_times:
    guess_input = int(input("请输入您要猜的数字："))
    guess_numer += 1
    if guess_input == target_number:
        flag = True
        break

if not flag:
    print("抱歉你输了")
else:
    print("恭喜你猜中了")
print("游戏结束")